package com.zzyl.controller;

import com.zzyl.base.ResponseResult;
import com.zzyl.dto.NursingLevelDto;
import com.zzyl.service.NuringLeverServer;
import com.zzyl.vo.NursingLevelVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/nursingLevel")
@Api(tags = "护理等级所有接口")
public class NursingLevelController extends BaseController{

    @Resource
    NuringLeverServer nuringLeverServer;
    @GetMapping("listAll")
    @ApiOperation("查询所有护理等级")
    public ResponseResult<List<NursingLevelVo>> selectAllNursingLevel(){

        List<NursingLevelVo> list = nuringLeverServer.selectAllNursingLevelServer();

      return success(list);

    }

    @PostMapping("/insert")
    @ApiOperation("新增护理等级")
    public ResponseResult addNursingLevel(@RequestBody NursingLevelDto nursingLevelDto){

        nuringLeverServer.nursingLevelServer(nursingLevelDto);
        return success();



    }


    @PutMapping("/{id}/status/{status}")
    @ApiOperation("启用禁用")
    public  ResponseResult EnableDisable(@PathVariable Integer id ,@PathVariable Integer status){

           nuringLeverServer.EnableDisableServer(id,status);
           return success();
    }

    @DeleteMapping("/{id}")
    @ApiOperation("护理等级删除")

    public ResponseResult DeleteNursingLevel(@PathVariable Integer id){


           nuringLeverServer.deleteServer(id);
           return success();




    }

}
